package testing.manager;

import javax.swing.JFrame;

import java.awt.Color;
import java.awt.Container;
import java.awt.Graphics;
import java.awt.Window;
import java.awt.event.MouseEvent;

import testing.module.GameScreenTest;
import utilities.manager.definederunner.GameRunner;
import utilities.module.definedmods.GameScreen;

public class GameRunnerTest extends GameRunner
{

	/**
	 * 
	 */
	private static final long serialVersionUID = 243535129617968095L;

	public GameRunnerTest(Container parent)
	{
		super(parent, null);
		this.setMainModule(new GameScreenTest(this));
	}
	
	public void drawScreen(Graphics g)
	{
		super.drawScreen(g);
		
		g.setColor(Color.red);
		g.fillRect(8, 30, 10, 10);

		g.setColor(Color.blue);
		g.fillRect(0, 0, 10, 10);
	}
	
	/*
	public void mouseClicked(MouseEvent e)
	{
		int realX = e.getXOnScreen();
		int realY = e.getYOnScreen();
		
		System.out.println("\"real\" (X, Y) = (" + realX + ", " + realY + ")");
		
		int baseX = e.getX();
		int baseY = e.getY();
		
		System.out.println("base (X, Y) = (" + baseX + ", " + baseY + ")");
		
		//getParent().getParent();

		//System.out.println(this.getClass().getName());
		//System.out.println(this.getParent().getClass().getName());
		//System.out.println(this.getParent().getParent().getClass().getName());
		//System.out.println(this.getParent().getParent().getParent().getClass().getName());
		//System.out.println(this.getParent().getParent().getParent().getParent().getClass().getName());
		//System.out.println(this.getParent().getParent().getParent().getParent().getParent().getClass().getName());

		Container topWindowLayer = this.getTopLevelAncestor();
		
		//this.getAncestorListeners();
		
		if(topWindowLayer != null)
		{
			int insetLeft = topWindowLayer.getInsets().left;
			int insetTop = topWindowLayer.getInsets().top;
	
			System.out.println("left inset = " + insetLeft);
			System.out.println("upper inset = " + insetTop);
			
			int screenX = baseX - insetLeft;
			int screenY = baseY - insetTop;
			
			System.out.println("screen (X, Y) = (" + screenX + ", " + screenY + ")");
		}
		
		System.out.println();
	}
	*/
}
